package com.htfyun.ft.common;

public enum BatteryCurrentThresholdEnum {

    stage1(0, 80, 1600),
    stage2(80, 90, 490),
    stage3(90, 100, 0),

    ;
    final int levelMin;
    final int levelMax;
    final int current;

    BatteryCurrentThresholdEnum(int min, int max, int current) {
        levelMin = min;
        levelMax = max;
        this.current = current;
    }

    /**
     */
    /**
     *电池level是否介于 min 和 max 之间, [min, max)
     *
     * @param level 电池电平
     * @return
     */
    public boolean isInRange(int level) {
        return (level >= levelMin && level <= levelMax);
    }

    public int getCurrent() {
        return current;
    }

//    private static final int BATTERY_CURRENT_THRESHOLD = 1600;
//    private static final int BATTERY_CURRENT_NINTY_PERCENT_LEVEL = 490;
//    private static final int BATTERY_CURRENT_ONE_HUNDRED_PERCENT_LEVEL = 0;

}
